/// @Classname : HcTagPage
/// @Author :
/// @Time : 2024-03-26 17:16
/// @Description : //todo

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hc_ui/config/hc_customer_config.dart';
import 'package:hc_ui/theme/hc_common_theme.dart';
import 'package:hc_ui/theme/hc_tag_theme.dart';
import 'package:hc_ui/utils/hc_gradient_util.dart';
import 'package:hc_ui/widget/button/hc_text_button.dart';
import 'package:hc_ui/widget/tag/hc_tag.dart';
import 'package:hc_ui/widget/title/hc_title.dart';

class HcTagPage extends StatefulWidget {
  const HcTagPage({Key? key}) : super(key: key);

  @override
  State<HcTagPage> createState() => _HcTagPageState();
}

class _HcTagPageState extends State<HcTagPage> {
  bool isSelected = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    HcCommonTheme commonTheme = HcCustomerConfig().allTheme.commonTheme;
    return Scaffold(
      backgroundColor: commonTheme.fillPageColor,
      appBar: AppBar(
        title: Text('HcTagPage'),
      ),
      body: ListView(
        padding: EdgeInsets.symmetric(
            vertical: commonTheme.vSpacingPage,
            horizontal: commonTheme.hSpacingPage),
        children: [
          const HcTitle.dot(
            title: "一般主题 ",
          ),
          Wrap(
            spacing: 8, runSpacing: 8,
            // mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              const HcTag(
                text: "NORMAL",
              ),
              HcTag(
                text: "CUSTOM_RADIUS",
                themeData: HcTagTheme(
                    borderRadius: const BorderRadius.only(
                        topLeft: Radius.circular(8),
                        bottomRight: Radius.circular(8))),
                tagStyle: HcTagStyle.error,
                tagType: HcTagType.normal,
              ),
              HcTag(
                text: "CIRCLE_RADIUS",
                themeData: HcTagTheme(
                    borderRadius: BorderRadius.circular(20),
                    padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2)),
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.normal,
              ),
              HcTag(
                text: "CIRCLE_RADIUS",
                gradient: HcGradientUtil.generateLinearGradient(degree: 45,colors: [Color( 0xfffea894), Color(0xffff1047)]),
                themeData: HcTagTheme(
                    borderRadius: BorderRadius.circular(20),
                    padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2)),
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.normal,
              ),
            ],
          ),
          const HcTitle.dot(
            title: "实心主题 ",
          ),
          Wrap(
            spacing: 8, runSpacing: 8,
            // mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              HcTag(
                text: "SUCCESS",
                tagStyle: HcTagStyle.success,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "ERROR",
                tagStyle: HcTagStyle.error,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "WARNING",
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "HELP",
                tagStyle: HcTagStyle.help,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "NOTICE",
                tagStyle: HcTagStyle.notice,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "PRIMARY",
                tagStyle: HcTagStyle.primary,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "NORMAL",
                tagStyle: HcTagStyle.normal,
                tagType: HcTagType.elevated,
              ),
            ],
          ),
          const HcTitle.dot(
            title: "状态主题 ",
          ),
          Wrap(
            spacing: 8, runSpacing: 8,
            // mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              HcTag(
                text: "SUCCESS",
                tagStyle: HcTagStyle.success,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "ERROR",
                tagStyle: HcTagStyle.error,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "WARNING",
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "HELP",
                tagStyle: HcTagStyle.help,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "NOTICE",
                tagStyle: HcTagStyle.notice,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "PRIMARY",
                tagStyle: HcTagStyle.primary,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "NORMAL",
                tagStyle: HcTagStyle.normal,
                tagType: HcTagType.state,
              ),
            ],
          ),
          const HcTitle.dot(
            title: "空心主题 ",
          ),
          Wrap(
            spacing: 8, runSpacing: 8,
            // mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              HcTag(
                text: "SUCCESS",
                tagStyle: HcTagStyle.success,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "ERROR",
                tagStyle: HcTagStyle.error,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "WARNING",
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "HELP",
                tagStyle: HcTagStyle.help,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "NOTICE",
                tagStyle: HcTagStyle.notice,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "PRIMARY",
                tagStyle: HcTagStyle.primary,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "NORMAL",
                tagStyle: HcTagStyle.normal,
                tagType: HcTagType.outlined,
              ),
            ],
          ),
          const HcTitle.dot(
            title: "图标标签 ",
          ),
          Wrap(
            spacing: 8, runSpacing: 8,
            // mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              HcTag(
                text: "SUCCESS",
                isReverse: true,
                icon: const Icon(Icons.check),
                tagStyle: HcTagStyle.success,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "ERROR",
                icon: const Icon(Icons.delete_forever),
                tagStyle: HcTagStyle.error,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "WARNING",
                icon: const Icon(Icons.warning),
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.state,
              ),
            ],
          ),
          const HcTitle.dot(
            title: "选中状态 ",
          ),
          HcTextButton(
              onPressed: () {
                setState(() {
                  isSelected = !isSelected;
                });
              },
              text: "点我切换状态"),
          Wrap(
            spacing: 8,
            runSpacing: 8,
            children: [
              HcTag(
                text: "PRIMARY_NO_SELECT",
                isSelected: !isSelected,
                tagStyle: HcTagStyle.primary,
                tagType: HcTagType.normal,
              ),
              HcTag(
                text: "PRIMARY_SELECT",
                isSelected: isSelected,
                tagStyle: HcTagStyle.primary,
                tagType: HcTagType.normal,
              ),
              HcTag(
                text: "SUCCESS_NO_SELECT",
                isSelected: !isSelected,
                isReverse: true,
                icon: Icon(Icons.check),
                tagStyle: HcTagStyle.success,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "SUCCESS_SELECT",
                isSelected: isSelected,
                isReverse: true,
                icon: Icon(Icons.check),
                tagStyle: HcTagStyle.success,
                tagType: HcTagType.outlined,
              ),
              HcTag(
                text: "ERROR_NO_SELECT",
                icon: Icon(Icons.delete_forever),
                tagStyle: HcTagStyle.error,
                isSelected: !isSelected,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "ERROR_SELECT",
                isSelected: isSelected,
                icon: Icon(Icons.delete_forever),
                tagStyle: HcTagStyle.error,
                tagType: HcTagType.elevated,
              ),
              HcTag(
                text: "WARNING_NO_SELECT",
                isSelected: !isSelected,
                icon: Icon(Icons.warning),
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.state,
              ),
              HcTag(
                text: "WARNING_SELECT",
                isSelected: isSelected,
                icon: const Icon(Icons.warning),
                tagStyle: HcTagStyle.warning,
                tagType: HcTagType.state,
              ),
            ],
          )
        ],
      ),
    );
  }
}
